﻿#region Copyright (C) 2008, 2009 StreamTv

/* 
 *      Copyright (C) 2008, 2009 StreamTv
 *      http://code.google.com/p/mpstreamtv/
 *
 *  This Program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2, or (at your option)
 *  any later version.
 *   
 *  This Program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 *  GNU General Public License for more details.
 *   
 *  You should have received a copy of the GNU General Public License
 *  along with GNU Make; see the file COPYING.  If not, write to
 *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 
 *  http://www.gnu.org/copyleft/gpl.html
 *
 */

#endregion

#region Imports
using TvEngine;
#endregion

namespace StreamTv2.Plugin
{
    /// <summary>
    /// Plugin class for the MediaPortal TvServer.
    /// </summary>
    public class TvServerPlugin : ITvServerPlugin
    {
        #region Variables
        // Private Variables
        private SmallWebServer webServer;
        // Protected Variables
        // Public Variables
        #endregion
        #region ITvServerPlugin Members
        #region Public properties
        // Public properties
        /// <summary>
        /// Author of the plugin.
        /// </summary>
        public string Author
        {
            get { return "Valk"; }
        } // Author
        /// <summary>
        /// Should this plugin only run on the Master TvServer.
        /// </summary>
        public bool MasterOnly
        {
            get { return true; }
        } // MasterOnly
        /// <summary>
        /// Name of the plugin.
        /// </summary>
        public string Name
        {
            get { return "Stream Tv 2"; }
        } // Name
        /// <summary>
        /// Configuration form for the plugin.
        /// </summary>
        /// <remarks>
        /// Form runs seperate from the TvService so don't expect any interaction (unless remoting is used).
        /// </remarks>
        public SetupTv.SectionSettings Setup
        {
            get { return new ConfigurePlugin(); }
        } // Setup
        /// <summary>
        /// Plugin version.
        /// </summary>
        public string Version
        {
            get { return "1.0.4.1"; }
        } // Version
        #endregion
        #region Public methods
        /// <summary>
        /// Starts the plugin.
        /// </summary>
        /// <param name="controller">Controller used for controlling the TvService.</param>
        public void Start(TvControl.IController controller)
        {
            webServer = new SmallWebServer();
            webServer.Start(controller);
        } // Start
        /// <summary>
        /// Stops the plugin.
        /// </summary>
        public void Stop()
        {
            webServer.Stop();
        } // Stop
        #endregion
        #endregion
    }
}